#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
int a[maxn * 2 + 5];
int b[maxn * 2 + 5];
int main() {
	freopen("palin.in", "r", stdin);
	freopen("palin.out", "w", stdout);
	int T;
	scanf("%d", &T);
	while (T--) {
		int n;
		scanf("%d", &n);
		for (int i = 1; i <= 2 * n; i++)
			scanf("%d", &a[i]);
		int S = 1 << (2 * n);
		bool f = false;
		for (int s = 0; s < S; s++) {
			int cnt = 0;
			int head = 1, tail = 2 * n;
			for (int j = 0; j < 2 * n; j++) {
				if ((1 << j) & s)
					b[++cnt] = a[tail--];
				else
					b[++cnt] = a[head++];
			}
			bool flag = true;
			for (int i = 1; i <= n; i++)
				if (b[i] != b[2 * n - i + 1])
					flag = false;
			if (flag) {
				for (int j = 0; j < 2 * n; j++) {
					if ((1 << j) & s)
						printf("R");
					else
						printf("L");
				}
				printf("\n");
				f = true;
				break;
			}
		}
		if (!f)
			printf("-1\n");
	}
}
